home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 4⁄13⁄90 / 1106-2.0 InModalMenuState-Apr90 < prev    next >
Encoding:
Text File  |  1990-04-16  |  1.3 KB  |  59 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    6816533                         13-April-90        15:51PDT
  4.  
  5. From:   ANIMATRIXDEV                    Animatrix, Steven Marcus,PRT
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. cc:     MACAPP.TEST                     MacApp SQA Team
  10.  
  11. Sub:    2.0 InModalMenuState bug
  12.  
  13.  
  14.  
  15.  
  16. Hi!
  17.  
  18.  
  19.  
  20. Another bug in MacApp 2.0 (3/22/90).
  21.  
  22. I opened a deskaccessory and was unable to pull-down any menus!!
  23.  
  24. As it happens the logic in the following routine is a little faulty, ie the
  25. case of a non-macapp window that isn't modal windowKind isn't handled:
  26.  
  27. FUNCTION TApplication.InModalMenuState: BOOLEAN;
  28.  
  29.    VAR
  30.    aWindow:TWindow;
  31.    aWindowPtr: WindowPtr;
  32.  
  33.    BEGIN
  34.  InModalMenuState := false;  <---- this line is missing
  35.  
  36.    aWindowPtr := FrontWindow;
  37.  
  38.    { in case the front window is an alert or something }
  39.  
  40.    IF (WMgrToWindow(aWindowPtr) = NIL) & (aWindowPtr <> NIL) THEN
  41.    CASE WindowPeek(aWindowPtr)^.windowKind OF
  42.    dBoxProc, plainDBox, altDBoxProc:
  43.    InModalMenuState := TRUE;
  44.    END
  45.    ELSE
  46.    BEGIN
  47.    aWindow := GetActiveWindow;
  48.    InModalMenuState := (aWindow <> NIL) & NOT aWindow.AllowsMenuAccess;
  49.    END;
  50.    END;
  51.  
  52.  
  53. The bug doesn't strike very often because MPW allocates space for the function
  54. result with a CLR.W -(A7), BUT Think Pascal 3.01 doesn't!!
  55.  
  56. thanks
  57. Steven Marcus@AnimatrixDev
  58.  
  59.